import lejos.nxt.Motor;
import lejos.nxt.SensorPort;
import lejos.nxt.UltrasonicSensor;
//2cm on the inside

public class UltraSonic {
	
	static Integer factor = 10;
	
	public static void objectDetection(){
		UltrasonicSensor US = new UltrasonicSensor(SensorPort.S2);
		US.continuous();
		Integer dist = US.getDistance();
		
		if( dist < factor )
		
		Print( dist.toString() );
	}
	
	public static void Print(String msg) {
		System.out.println( msg );
	}
	
	public static void TurnLeft(){
		Motor.A.forward();
		Motor.B.backward();
	}
	
}
